
package nc.bs.pub.action;

import nc.bs.framework.common.NCLocator;
import nccloud.bs.hrjx.bill.aggbusi.plugin.bpplugin.JxXsDataVOPluginPoint;
import nc.bs.pubapp.pf.action.AbstractPfAction;
import nc.impl.pubapp.pattern.rule.processer.CompareAroundProcesser;
import nccloud.itf.hrjx.bill.IJxxsdatavoMaintain;
import nc.vo.hrjx.jxxsdata.AggJxXsDataVO;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

public class N_ZH01_DELETE extends AbstractPfAction<AggJxXsDataVO> {

        @Override
        protected CompareAroundProcesser<AggJxXsDataVO> getCompareAroundProcesserWithRules(
                        Object userObj) {
                CompareAroundProcesser<AggJxXsDataVO> processor = new CompareAroundProcesser<AggJxXsDataVO>(
                                JxXsDataVOPluginPoint.SCRIPT_DELETE);
                // TODO 在此处添加前后规则
                return processor;
        }

        @Override
        protected AggJxXsDataVO[] processBP(Object userObj,
                        AggJxXsDataVO[] clientFullVOs, AggJxXsDataVO[] originBills) {
                IJxxsdatavoMaintain operator = NCLocator.getInstance().lookup(
                                IJxxsdatavoMaintain.class);
                try {
                        operator.delete(clientFullVOs, originBills);
                } catch (BusinessException e) {
                        ExceptionUtils.wrappBusinessException(e.getMessage());
                }
                return clientFullVOs;
        }

}
